package JZOffer;

public class JzOffer53_I {
    public int search(int[] nums, int target) {
        int count = 0;
        for (int i = 0; i < nums.length; i++) {
            if (nums[i] == target) {
                while (i < nums.length && nums[i] == target) {
                    count++;
                    i++;
                }
                return count;
            }
        }
        return 0;
    }
}
